package org.project.areader.util;

import org.project.areader.activity.SettingActivity;

import android.content.Context;
import android.content.SharedPreferences;
import android.view.Display;
import android.view.WindowManager;

/**
 * 
 * @author robin
 * @date 2011-3-21
 * 
 */
public class Global
{
	public static final String TAG = "org.project.AReader:";

	public static int SCREENWIDHT;

	public static int SCREENHEIGHT;

	public static String TEXTCOLOR;

	public static int TEXTFONTSTYLE;

	public static int TEXTSEIZ;

	public static int TEXTAUTO;
	
	public static boolean ISSAVEMARKS;

	public static void init(Context context)
	{
		Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
		SCREENWIDHT = display.getWidth();
		SCREENHEIGHT = display.getHeight();

		SharedPreferences settings = context.getSharedPreferences(SettingActivity.PREFS_NAME, 0);
		Global.TEXTCOLOR = settings.getString(SettingActivity.FONT_COLOR, "#ffffff");
		Global.TEXTSEIZ = settings.getInt(SettingActivity.FONT_SIZE, 20);
		Global.TEXTAUTO = settings.getInt(SettingActivity.FONT_AUTO, 1);
		Global.TEXTFONTSTYLE = settings.getInt(SettingActivity.FONT_STYLE, 0);
		Global.ISSAVEMARKS = settings.getBoolean(SettingActivity.ISSAVEMARKS, false);
	}

}
